<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
     document.addEventListener('click',function(e){
        // 浏览器可视区域的顶端到鼠标点击的X，Y轴距离
        console.log(e.clientX);
        console.log(e.clientY);
        // 从顶端到点击的x，y轴距离（推荐
        console.log(e.pageX);
        console.log(e.pageY);
       })
    </script>
</body>
</html>